let input_arr = ['3']


let N = parseInt(input_arr[0])
result =0;
for(let i=1; i<=N; i++){
    let tmp = 1;
    for(let j=1; j<=i; j++){
        tmp = tmp * j;
    }
   result += tmp
}
console.log(result);